package com.ewing.busi.carry.dao;

import javax.annotation.Resource;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Repository;

import com.ewing.busi.carry.model.WebCarryTemplate;
import com.ewing.core.jdbc.BaseDao;

/**
 * 
 * @author chenxuegui@163.com
 * @createDate 2016年9月3日
 */
@Repository("webCarryTemplateDao")
public class WebCarryTemplateDao {
  
  @Resource 
  private BaseDao baseDao;
  
  public WebCarryTemplate findByShopIdAndName(Integer shopId,String name){
    if(null == shopId || StringUtils.isEmpty(name)){
      return null;
    }
    
    StringBuilder query = new StringBuilder();
    query.append(" shop_id = ").append(shopId);
    query.append(" and name = '").append(name).append("'");
    return baseDao.findOne(query.toString(), WebCarryTemplate.class);
  }
  
  

}
